package main

import (
	"fmt"
	"strconv"
)

func main() {
	var a int = 10
	var b float32 = float32(a)

	fmt.Printf("a is of type %T and its value is %v\n", a, a)
	fmt.Printf("b is of type %T and its value is %v\n", b, b)

	// 使用strconv包进行类型转换
	var num_str string = "123a"
	var num int
	num, err := strconv.Atoi(num_str)
	if err!= nil {
		fmt.Println(err)
	}
	fmt.Printf("num is of type %T and its value is %v\n", num, num)
}